package com.itheima.dao;

import com.itheima.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserDao {
    //查找所有
    @Select("select * from tbl_account")
    List<User>findAll();
    //通过id查找
    @Select("select * from tbl_account where id=#{id}")
    User findbyid(int id);
    //添加
    @Insert("inser into tbl_account values(null,#{name})")
    int add (User user);
    //修改
    @Update("update tbl_account set name=#{name} where id=#{id}")
    UserDao updateUser(User user);
    //删除
    @Delete("delete * from tbl_account where id=#{id}")
    int deletebyid(int id);

}
